package com.sl.core.engine.log;

import lombok.Getter;
import lombok.Setter;
import org.apache.hop.core.logging.HopLoggingEvent;
import org.apache.hop.core.logging.ILoggingObject;

public class ProcessLoggingEvent extends HopLoggingEvent {
    @Getter
    @Setter
    private Boolean wrapperSpecCharFlag;
    @Getter
    @Setter
    private Boolean logDetailFlag;

    public ProcessLoggingEvent(HopLoggingEvent kettleLoggingEvent) {
        this.setMessage(kettleLoggingEvent.getMessage());
        this.setLevel(kettleLoggingEvent.getLevel());
        this.setTimeStamp(kettleLoggingEvent.getTimeStamp());
    }

    public String getTid() {
        Object message = this.getMessage();
        if (!(message instanceof ProcessLogMessage)) {
            return null;
        }
        ProcessLogMessage openSkyLogMessage = (ProcessLogMessage) message;
        return openSkyLogMessage.getTid();
    }

    public String geInstanceId() {
        Object message = this.getMessage();
        if (!(message instanceof ProcessLogMessage)) {
            return null;
        }
        ProcessLogMessage openSkyLogMessage = (ProcessLogMessage) message;
        return openSkyLogMessage.getInstanceId();
    }
}
